package com.wy.model;

import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.validation.constraints.NotBlank;

import com.wy.annotation.Sort;
import com.wy.annotation.Unique;
import com.wy.base.AbstractPager;
import com.wy.valid.ValidEdit;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;

/**
 * 字典表
 * @author paradiseWy
 */
@ApiModel("字典表")
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@ToString
@Builder
@Table(name = "td_dic")
public class Dic extends AbstractPager {
	private static final long serialVersionUID = 1L;

	@ApiModelProperty("字典编号")
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@NotBlank(groups = ValidEdit.class)
	private String DicID;

	@ApiModelProperty("字典名称")
	@NotBlank
	private String DicName;

	@ApiModelProperty("字典编码")
	@NotBlank
	@Unique(hump2Snake = false)
	private String DicCode;

	@ApiModelProperty("上级字典编号")
	@NotBlank
	private String ParentID;

	@ApiModelProperty("排序")
	@Sort(hump2Snake = false)
	private Integer SortIndex;
}